function httpPost(URL, PARAMS) {
var temp = document.createElement("form");
temp.action = URL;
temp.method = "post";
temp.style.display = "none";

for (var x in PARAMS) {
var opt = document.createElement("textarea");
opt.name = x;
opt.value = PARAMS[x];
temp.appendChild(opt);
}

document.body.appendChild(temp);
temp.submit();

return temp;
}
function btnAction_Edit(id)
{
    var number = prompt("请输入修改后的title","");
    alert("修改成功");
    var params = {
            "data":number,
            "id":id
                };
    httpPost("http://127.0.0.1:5000/show", params);
}
function btnAction_Done(id1,id2,id3)
{
    var number = document.getElementById(id1);
    var button_name = document.getElementById(id2);
    if(button_name.innerHTML == "Undo")
    {
        number.style.textDecoration = "none";
    }
    else
    {
        number.style.textDecoration = "line-through";
    }
    var params = {
            "data1":button_name.innerHTML,
            "id1":id3
                };
    httpPost("http://127.0.0.1:5000/show", params);
}
function btnAction_Remove(id)
{
    alert("移除成功");
    var params = {
            "id2":id
                };
    httpPost("http://127.0.0.1:5000/show", params);
}
